package iwpl.teky.sample.entities;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * News entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "News")
public class News implements java.io.Serializable {

	// Fields

	private Integer newsId;
	private Categories categories;
	private String title;
	private String shortContent;
	private String fullContent;
	private Timestamp createDate;
	private String source;
	private Boolean status;

	// Constructors

	/** default constructor */
	public News() {
	}

	/** minimal constructor */
	public News(Integer newsId, Categories categories, String title,
			String shortContent, String fullContent, Timestamp createDate,
			Boolean status) {
		this.newsId = newsId;
		this.categories = categories;
		this.title = title;
		this.shortContent = shortContent;
		this.fullContent = fullContent;
		this.createDate = createDate;
		this.status = status;
	}

	/** full constructor */
	public News(Integer newsId, Categories categories, String title,
			String shortContent, String fullContent, Timestamp createDate,
			String source, Boolean status) {
		this.newsId = newsId;
		this.categories = categories;
		this.title = title;
		this.shortContent = shortContent;
		this.fullContent = fullContent;
		this.createDate = createDate;
		this.source = source;
		this.status = status;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "NewsID", unique = true, nullable = false)
	public Integer getNewsId() {
		return this.newsId;
	}

	public void setNewsId(Integer newsId) {
		this.newsId = newsId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CategoryID", nullable = false)
	public Categories getCategories() {
		return this.categories;
	}

	public void setCategories(Categories categories) {
		this.categories = categories;
	}

	@Column(name = "Title", nullable = false)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "ShortContent", nullable = false)
	public String getShortContent() {
		return this.shortContent;
	}

	public void setShortContent(String shortContent) {
		this.shortContent = shortContent;
	}

	@Column(name = "FullContent", nullable = false)
	public String getFullContent() {
		return this.fullContent;
	}

	public void setFullContent(String fullContent) {
		this.fullContent = fullContent;
	}

	@Column(name = "CreateDate", nullable = false, length = 23)
	public Timestamp getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Timestamp createDate) {
		this.createDate = createDate;
	}

	@Column(name = "Source")
	public String getSource() {
		return this.source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	@Column(name = "Status", nullable = false)
	public Boolean getStatus() {
		return this.status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

}